package com.imti.mall.order.controller;

import com.imti.mall.common.Api.CommonResult;
import com.imti.mall.model.order.pojo.OmsCompanyAddress;
import com.imti.mall.order.service.OmsCompanyAddressService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@Api(tags = "地址管理")
@RequestMapping("/api/v1/orders/companyAddress")
public class OmsConpanyAddressController {

  @Autowired
  private OmsCompanyAddressService omsCompanyAddressService;

  @ApiOperation(value="地址列表")
  @GetMapping("/list")
  public CommonResult getAddressList(){
    List<OmsCompanyAddress> omsCompanyAddressList = omsCompanyAddressService.list();
    return CommonResult.success(omsCompanyAddressList);
  }
}
